class SingletonPattern {
    private int id;

    int getId() {
        return this.id;
    }
    //todo 这里报错不知道为什么  
    // privite SingletonPattern() {

    // }

    private  static SingletonPattern Instance = new SingletonPattern();
    static SingletonPattern getInstance() {
        return Instance;
    }
   
}
class test {
    public static void main(String[] args) {
        SingletonPattern singleton = SingletonPattern.getInstance();
        SingletonPattern singleton2 = SingletonPattern.getInstance();

        System.out.println("id：" + singleton.getId());
         System.out.println("id：" + singleton2.getId());
       
    }
}